more work on epub
minor refactoring