moving functions outside of post