Refactored code, deleted unused code.