add ut, clean code