Updates and refactoring