Refactored code to ensure extensiblity of updating alpha and theta/

Signed-off-by: unknown <viveksck@gmail.com>