Simply refactoring 590-ending

need to further refactoriza