clean-up and code style improvements