Refactored to separate kmc logic from display code