Better function names, moved function to element.js