refactoring to remove problem struct