optimize and fix storage

1. use break to speed up the loop
2. storage support plain object