Moved code into elements classes.