Simplify code a bit