Factoring out Java helpers into their own class