Add string extension
Refactor spec logic