Moved code to their respective classes.