code revision and enhancement