remove tag from entry and refactor some code