refactor trundle lib