refactored code to make app compatible with Android ICS+ only