improving logic and interface