Use protected methods

Use protected methods so that extending classes can override them.
Merge pull request #172 from jenssegers/patch-1

Use protected methods