cleanups, initial commit of helper functions for common manipulations