Replace java classes with scala equivalents