removed unused code and fixed spec