updated readme and minor code refractorization