fix ip address and refactor spec