added tests, refactored
update added