database refactor on the way