remove code duplication 7902e98