Refactoring: Separate out GUI and Backend components