Added get&set methods, some refactoring