Function transferred to appropriate files, code cleanup, moved dalvik cache confirmation to the end