some tests added
minor refactor