js refactoring (move out  specific logic from _Layout)
fix ui