Add save/load logged module functionality
Cleanup code