Refactored with static. Prepared for building.  Removed unused code