maybe we should have a helper method for this? this looks used in several places