minor fix and code clean-up