Done some major code clean up