Refactoring and new stuff