Made some functions inline