Code simplification (to be continued)