Move functional methods out of main class