moved tray functions to own file