Code cleanup, reduction of duplicate logic
Refactored extra logic code to different files
Continued refactor
Merge pull request #19 from reesk93/LogicImprovements

Logic improvements