more refactor. add more functions