Complete refactoring.
Merge branch 'function/selectors' 'refactoring'