updated readme and some more refactorings