Simplifications
Reorganize code layout