Remove unneeded code duplication