moving functions out into their own file