begin angular refactor