moved apc into seperate file