code refactoring; cleaning up and reorganization in process