splitted functions into 2 files