source restructuring + documentation