tighten up code. Start adding integration