minor code restructure #127