separated functions/config into separate files; added min/max length param