further refactoring
clear seperation of gui and logic