Refactor

Migrated away from single file to modular design pattern
now that code base is over 1000 lines.