refactor deck