moved structs and methods to common