Cleaned up element.js