remove unnecessary code duplication