bug in element type; refactoring app initialize