Refactored pre-commit hooks