cleaned up main class

removed all non essential functions and variables to there own home
tidying it up a bit