please factor this block out as a helper method