Created separate function for master/slave config

To modularize slave and master configuration, created separate
functions - _configure_master and _configure_slave.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>