Refactor work in progress