Restructure repo layout
Fix bugs