make functions protected instead of private