some refactoring - removed unused functions