code cleanup for relation fill
refactor + (wrong) new code
added tests
huge code refactor, retrieve releation is not implemented