feature & test: #773 remove some code duplication, better modularization, tab to move to next file edit input