Code organization a cleanup