code cleanup and scala first