Optimize "Share-it" code