initial refactoring for functional style
adding functional module
refactoring
changing controller
Minor tweaks
Merge pull request #1 from stavinski/functional

Functional