Remove more code duplication