make java efficient