Added buttons to select chain types
Code refactoring