extracting out functions into super classes