Improve logging and behaviour

Create staging repo only when needed, and added
more logging