refactoring, adding min sdk version 14 -

extracting logic from activity