beautification and code refactoring