Move Class and Funcs out of main