Minor clean-up and added inline documentation