Factor out common method