Cleaned up code organization.