Reduce complexity by reusing code