Minor updates and refactoring