refactoring, formatting code, removed not used code in swipe