Refactor methods to make specs pass