Reformated code a bit