add new features: remove thumb. Simplify the code.