refactored cli and frontend