code review to #314, use enum and create unmanaged location