create functions separated from fill functions

create functions separated from fill functions