DDBNEXT-27 refactor code

  - extract method
  - remove finished TODO