Cleaned Up Code and Fixed Encapsulation Issues

General code refactoring. See differential for details.