more work on site - some refactoring