Function work, code is getting cleaner.