complete refactoring & added unit tests
filled composer.json