major refactoring
major refactoring part 2
Merge pull request #3 from zajd/major_refactor

Major refactor