density hull driver and functions - refactor