did some refactoring on tiny-spa lib