beginning add refactor