Code Cleanup and usability improvements