improving modularization and using promises
improve tag affectation