refactored var-declarations and variable names