change to use enum directly