Refactoring based on review comments