Improve variable names and documentation