making it as helper method