Cleaned up optional usage, moved debug statements to logging