minor changes to make structure more understandable