simplification of the code