close to tray
some refactoring