clean up function to be more consistent with coding guidelines