code refactoring, readme updated and device scripts added