Interface refactoring

and some minor fix