Finish prototyping and move testing code outside