implement internal classes - closes #28