Further annotations and refactoring