Fixed refactoring

Initial refactoring left some wrong
variable names.