code refactore