simplify code a lil'