Minor refatoring
More tests