data attribute added + code refactored