internal code simplification