Reverted copy & inner_product to ensure build passes + some code clean up