refactoring: add nullness annotations