style and code refactor