fixing formatting and useless dictionary elements