refactoring src and spec to make it more accurate