Organization

Fixed some code organizational issues.