some functional style cleanups