Refactor request module