reposition arrow & refactor code