refactoring & add basic func router support