moved some abstract files and add result iterator for database