Refactor to simplify
Merge branch 'master' of https://github.com/homoud100/ProgrammingAssignment2