clean up and add the ability to bind functions