Refactored to use OJCommon