refactored the code

Signed-off-by: Viduranga Wijesooriya <vpowerrc@gmail.com>
made the app responsive

Signed-off-by: Viduranga Wijesooriya <vpowerrc@gmail.com>