Capmt rework

Please review.
If you want to see real changes just do 'git show -w' (there is a lot of indentation changes).