some refactoring
fixed some specs