Improve interface and internal refactoring