Restructure code. Mock option. Better sync + fixes