Refactoring

Fixed code layout.