UI partialy working, more code cleanup