Remove code duplication

;)