Refactoring

Cleaned up global name space - created sub name spaces with
variables/functions instead