minor design and code changes