Refactor complex methods in controllers

Improve validateSecretChecker and getFormData