revising new functionality to use dynamic partial and refactored functionality into notes controller