Cleaned up code some