Switched production logic to scala