refractoring gui - part1