Improve scala support