refactor
user category insteda of c helper function