Removed basic event handler functionality from main and movied into event handler file/function.