Improves activity handling