element factory WIP; refactoring