Moved function calls to main statement