minor code refactors