Renamed specs, refactor to make code more testable