tidy up formatting and fix rubymine warnings