[#1027] change function statements to expressions
(#1010) - Switch where plugin registration happens