extracted helper method