simplify variable names and remove unused variable