made helper methods protected for unit testing