Business logic cleanup
end of refactor

fixed #9