Trying to clean gui code