improved the auto implementation