Code refactory

1) adding exception layer, 2) adding utility class 3) adding separation
from view and mode, view to services.