refactor code and add revison field to episodes #158