Reduce code complexity