Clarify variable names and clean up