adding refactorings.
Merge pull request #27 from abeykoon/refectoring-stage1

adding refactorings.