code moved into a library