GM: Code refactoring based on review