add spec, extract methods
Merge pull request #4 from sinsoku/feature/refact

add spec, extract methods