start to refactor
adding rspec tests
refactor classes