1) refactored code

2) creating button controls from xml