Cleaning up code, adding python templates