refactorization and ip function