Refactored and added visiblity to instancevariables