localhost class

created a localhost class to cleanup the code