Duplicate code fix