code cleanup: making some function params optional