Refactoring GUI part.