some cleanup, added conversion functions