Format code in controllers