Split PLA function into separate file