Cleaned up function semantics