Refactoring + Fixed code style.