remove basics and replace with standard library + cleanup