seperated some logic