Refatored the post adapter