change application from java to scala