refactor and add one more spec