eHome an pHome code cleaned up