Need to refactor and update generation method