add rspec
refactor methods and constants