refactor into subgenerators, add router config and layout files