Shared init code

Instead of replicate code, all initialization methods have been overridden to call a common method 'commonInit' where to put shared initialization code.