refactor + some gui additions