Moved methods and event around to clean up code