refactor begins!!

seperated utility