Code simplification, formatting