Remove unused functions
Small simplification
remove some duplication
Small cleanus