clear up code a bit