extract MainAdapter class to it's own file