Small refactor + adding some annotations.