Made some functions const