Restructure coding package to seperate types and database from package logic.