Refactor duplication

- Removed some duplication. 
 * pulled the conditions out into methods
 * removed for-duplication 
 * returning *this*, so that we properly chain methods. The current implementation wasn't following this structure all the way. Some times it didn't return anything, returned this or the parent.