fixed tests
refactored ui behaviour