Add modules to handle XLS. Some code refatoring