gobi: minor improvements to the code and cleanup