code reorganization

Signed-off-by: Anand Avati <avati@redhat.com>