Complete re-write

Complete re-write to more external method-friendly code