Cleaned up event logic, moved entirely into layout controller