refactored getNewElement