Implemented move and copy assignment separately for better performance.