move custom stuff out of lib