refactor postmark controller