cleaned some functions