Refactor request handlers