Refactor CategoryList: used state machine to handle CateogryList editing/adding/normal