Move user configuration into class initialization
Remove duplicate variable definitions
Remove unused parameter
Remove unused function