Refactor dotspec