slight refactoring, changed visibility modifiers from public to protected