further code simplification