more styling and refined logic