refactoring some js methods and increasing documentation on readme