Cleaned up selected gameobject code