separating the functions for better clarity