tuning, refactor and optimize
targeting ios6