Reduce the complexity of the code