simplify code blocks