fixes automake
refactors to make testing easier