Move functions outside of plugin block