Refactor, fix swap and move methods

Use each method instead of loop.