Working on refactoring code.