reduced code duplication
tests added for all methods