clean up codes from educational viewpoints