Moved to JavaConfig and some cleanup.