Minor code refactory