refactor once again