REFACTOR 
1. Groovy converted
2. Adding DB stuff