prepared some tool functions for the following commit