minor code updates/refactoring