added subgenerators, clean code and structure