Implement behaviour http get request and refactor code.