more compact prototype extending
extract element.children
code refactoring