Add Sharepref and refactor App