Tecan code refactoring