Organized initializers and layout into functions. removed selector function and put it in the mouse listener