added adaptor call and refactor (clean code)