splitted functions to separate files