removes unecessary variable assignment and refines formatting