Refactor plates to plates decoder