moving functions into out of class