Refactoring some code style