Made functions more consistent