refactoring UI checker--works much better now