refactoring the IP function into a module
refactoring the local-ip function to a module