refactor to avoid genthod dep