pre-controller refactor