move license into separate file + refactoring
improve error class names and DRY code
drop validateElement function and refactoring
update README