Refactored some more: re-integrated the animationloop and resize methods