Code Cleanup, added public functions