Refactor, add domain spec