A minor code organization

minor code organization