Changed some methods to protected instead of private

This is to make it easier to extend the class.

FYI, first pull request I've sent so I hope it's correct.