Refactoring and groovy. Add DB schema.