minor code refactors

minor code refactors