Tidy up code, seperate listeners into seperate classes, fix a lot of errors