Added business unit, input validation, some refactoring