more code optimization