Small changes to code to simplify reading