improved code readability and exception handling.