adding more e2e test and refactoring