Moved CSS declaration to window and cleaned up some code.