code refactor + working Clear button