Small correction and code organization