Layer by layer approach to transport in noncollinear magnetic structures