Refactor logic out from __invoke() into specific private methods