Clean up code duplication for revision parsing and fix previous commit to not