Better stub generation