Refactored code and aditional specs