chore: cleans up unused vars and replaces angular.foreach with native