Factored out helper methods