Reove unused var
Add sample
Reduce code