Refactored Java guide