Refactoring - modify name of variables, funtionalize