Refactored terminal