tidy code a little