small code refactor in commons