Simplify code structure