re-write / re-factoring needed