Almost finished interface
Some code refactoring