Refine code. Use pixel unit at all places.