Yes, such local methods are ideal for this application. An alternative is to import the instance methods that you need in the scope:
def createRecaptchaHtml: String = { import Play.current.configuration.getString ReCaptchaFactory.newReCaptcha( getString("recaptcha.publicKey").get, getString("recaptcha.privateKey").get, false ).createRecaptchaHtml(null, null) }
source share