Partial GUI implementation, partial code cleanup