Code and rings cleanup