Refactored: used proper coffee syntax in 'and' condition