Remove code duplication in note controller

[#71835198]