bunch of stuff + java gen (this is terrible...)