refactory functions