Refactored signature and validation functionality