clean up conditional logic a bit, add handling for interfaces