refactoring

messages in a common specific file
selector have text type by default
rename some variables
format the code