Style cleanup, encapsulating code