major refactoring with fetching