grails function improved