changes
- restructure internal class
- added tag mechanism
- fixed comments