Prettified code somewhat