Simplify redundant code