move funcs to separate file