implement internal classes - closes #26