Clients module refactor

This is XXL. Sorry about that.