Java: refactoring of NorthBreeze sample