Decrease complexity of the code