refactor: change the type of unit from int to enum
move enum Unit to another file