move inline memberships code to separate file

reduces the size of the app file which should make it a bit more
readable