Simplifying the 'with' statements and removing an indentation level