Moved inner classes into seperate classes. Thanks Mitsugaru for the tip :)