Simplification of the code