Implemented conditions using templates.