Adding ui + refactoring